import platform
import os
import json

sy=platform.system()
if sy=='Windows':
    path_sep='\\'
elif sy=='Linux':
    path_sep='/'
basedir=os.path.abspath(os.path.dirname(__file__))

with open('private.json') as f:
    private=json.load(f)

class Config:
    DEBUG=True
    SECRET_KEY=os.environ.get('SECRET_KEY') or 'hard2guess'
    if sy=='Linux':
        SQLALCHEMY_DATABASE_URI=os.environ.get('DATABASE_URL') or f'mysql://root:{private["mysql_pwd"]}@localhost:3306/asrmbt' # linux(docker-ubuntu)、原生ubuntu上可能需要改成mysql+pymysql协议
    elif sy=='Windows':
        SQLALCHEMY_DATABASE_URI=os.environ.get('DATABASE_URL') or f'mysql://root:{private["mysql_pwd"]}@localhost:3306/asrmbt'
    SQLALCHEMY_TRACK_MODIFICATIONS=False
    SQLALCHEMY_COMMIT_ON_TEARDOWN=False
    WTF_CSRF_CHECK_DEFAULT=False